import functools
class Solution(object):
    def numOfArrays(self, n, m, k):
        base = 10 ** 9 + 7
        @functools.cache
        def dfs(i, x, k):
            if i + 1 < k:
                return 0
            if x < k:
                return 0
            if k == 0:
                return 0
            if i == 0:
                if k == 1:
                    return 1
                else:
                    return 0
            ans = 0
            for t in range(1, x):
                ans = (ans + dfs(i - 1, t, k - 1)) % base
            ans = (ans + dfs(i - 1, x, k) * x) % base
            return ans
        ans = 0
        for i in range(1, m + 1):
            ans = (ans + dfs(n - 1, i, k)) % base
        return ans


data = Solution()
n = 2
m = 3
k = 1
print(data.numOfArrays(n, m, k))